<?php

namespace App\Libs;

class SecurityLib
{
    /**
     * 加密密码
     * @param $password
     * @return false|string|null
     */
    public function passwordEncrypt($password)
    {
        return password_hash($password, PASSWORD_BCRYPT);
    }

    /**
     * 验证密码合法性
     * @param $password
     * @param $passwordHash
     * @return bool
     */
    public function verifyPassword($password, $passwordHash)
    {
        return password_verify($password, $passwordHash);
    }
}
